﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CoastalClimbing.Code;

namespace CoastalClimbing
{
    public partial class GalleryImages : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)            
                this.BindInfo();                
        }

        private void BindInfo()
        {
            string galleryid = Request.QueryString["GalleryID"].ToString();

            if(galleryid.ToUpper().Equals("7507B2D0-20FE-40FC-8A6D-C9A3B43FC570"))
            {
                Response.Redirect("~/Videos.aspx");
            }

            string galleryname = DAL.GallerySelectName(galleryid) + " Gallery";

            lblGalleryName.Text = galleryname;
            Page.Title = "Coastal Climbing - " + galleryname;

            dtlGallery.DataSource = DAL.GalleryImageSelect(galleryid);
            dtlGallery.DataBind();
        }
    }
}